Concerning the problem that how to initialize the weights of deep neural networks, which resulted in poor solutions with low generalization for spam filtering, a classification method of Deep Belief Net (DBN) was proposed based on the fact that the existing spam classifications are shallow learning methods. The DBN was pre-trained with the greedy layer-wise unsupervised algorithm, which achieved the initialization of the network. The experiments were conducted on three datesets named LinsSpam, SpamAssassin and Enron1. It is shown that compared with Support Vector Machines (SVM) which is the state-of-the-art method for spam filtering in terms of classification performance, the spam filtering using DBN is feasible, and can get better accuracy and recall.